//
//  ViewController.m
//  MVP框架设计_OC
//
//  Created by globalives2 on 2017/2/27.
//  Copyright © 2017年 globalives2. All rights reserved.
//

#import "ViewController.h"
#import "LoginView.h"
#import "LoginPresenter.h"

@interface ViewController ()<LoginView>
@property (nonatomic) LoginPresenter *presenter;
@end

@implementation ViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _presenter = [[LoginPresenter alloc]init];
    // 绑定
    [_presenter attachView:self];
    // 调用p层
    [_presenter loginWithName:@"Login" password:@"123456"];
    
}

- (void)onLoginResult:(NSString *)result {
    NSLog(@"服务器登陆返回结果： %@",result);
    // 解除
    [_presenter detachView];
}

@end
